package ru.hashcode.hashdroid.proxy;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;


public class Question extends Node implements Iterable<Answer> {
	private String head;
	private ArrayList<Answer> children = new ArrayList<Answer>();;
	private ArrayList<Comment> comments = new ArrayList<Comment>();
	Question(User author, String head, String text) {
		super(author, text);
		this.head = head;
	}
	public String getHead() {
		return head;
	}
	public void addChild(Answer child){
		this.children.add(child);
	}
	public void removeChild(Answer child){
		this.children.remove(child);
	}
	@Override
	public Iterator<Answer> iterator() {
		return children.iterator();
	}
	public String toString() {
		return head;
	}
	public int getAnsCount() {
		return children.size();
	}
	public final List<Comment> getComments() {
		return comments;
	}
	public final List<Answer> getAnswer() {
		return children;
	}
}
